﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UserCenter.master" AutoEventWireup="true" CodeBehind="UserAddress.aspx.cs" Inherits="FastShip88.UserAddress" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Script_User" runat="server">
  <script type="text/javascript" language="javascript" src="Script/PCASClass.js" charset="gb2312"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="server">

    <div id ="divAddrList" style="padding-left:10px" >
        <asp:GridView ID="gvAddrList" runat="server" AutoGenerateColumns="False" 
            DataSourceID="LinqDataSource1" Width="744px" BackColor="White" 
            BorderColor="#336666" BorderStyle="None" BorderWidth="3px" CellPadding="4" 
            DataKeyNames="id" GridLines="Horizontal" onrowdeleting="gvAddrList_RowDeleting" 
            onrowediting="gvAddrList_RowEditing" 
            onselectedindexchanging="gvAddrList_SelectedIndexChanging">
            <RowStyle BackColor="White" ForeColor="#333333" />
            <Columns>
                <asp:CheckBoxField DataField="IsDefault" HeaderText="缺省" ReadOnly="True" 
                    SortExpression="IsDefault">
                <ItemStyle HorizontalAlign="Center" Width="40px" />
                </asp:CheckBoxField>
                <asp:BoundField DataField="receiptor" HeaderText="收件人" ReadOnly="True" 
                    SortExpression="receiptor">
                <ItemStyle Width="80px" />
                </asp:BoundField>
                <asp:BoundField DataField="Address" HeaderText="地址" ReadOnly="True" 
                    SortExpression="Address">
                <ItemStyle Width="300px" />
                </asp:BoundField>
                <asp:BoundField DataField="PostCode" HeaderText="邮政编码" ReadOnly="True" 
                    SortExpression="PostCode">
                <ItemStyle HorizontalAlign="Center" Width="60px" />
                </asp:BoundField>
                <asp:CommandField EditText="编辑" ShowEditButton="True">
                <ItemStyle HorizontalAlign="Center" Width="50px" />
                </asp:CommandField>
                <asp:CommandField DeleteText="删除" ShowDeleteButton="True">
                <ItemStyle HorizontalAlign="Center" Width="50px" />
                </asp:CommandField>
                <asp:CommandField SelectText="设为缺省" ShowSelectButton="True">
                <ItemStyle HorizontalAlign="Center" Width="80px" />
                </asp:CommandField>
            </Columns>
            <FooterStyle BackColor="White" ForeColor="#333333" />
            <PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle Font-Bold="False" />
            <HeaderStyle BackColor="#CCCCCC" Font-Bold="True" ForeColor="White" />
        </asp:GridView>
        <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
            ContextTypeName="FastShip88.DBAccess.UsersDataContext" 
            Select="new (id, Address, PostCode, receiptor, IsDefault)" 
            TableName="UserAddresses" EnableDelete="True" EnableUpdate="True">
        </asp:LinqDataSource>
        
        <hr />
        </div>
            
    
    <div id="divEdit" runat="server" style="padding-left:10px; padding-top:10px" >
        <h4>添加或修改收货地址</h4>
				<table>
					<tr>
						<td style="text-align:right">收货人姓名<font color="red">*</font>：</td>
						<td>
							<input name="receiptor" type="text" maxlength="20" size="20" value="<%=userAddress.receiptor %>" />
						</td>
					</tr>

					<tr>
						<td style="text-align:right">地区<font color="red">*</font>:</td>
						<td>
							<select name="province" > </select>
							<select name="city"></select>
							<select name="area"></select> 
							<script type="text/javascript" language="javascript" defer="defer">
							    new PCAS("province", "city", "area", "<%=province %>", "<%=city %>", "<%=area %>");
							</script>									
						</td>								
					</tr>
					<tr>
						<td style="text-align:right">街道地址<font color="red">*</font>：</td>
						<td>
							<input  name="street" type="text" size="40" maxlength="40" value="<%=street %>" />
						</td>
					</tr>
					<tr>
						<td style="text-align:right">邮政编码<font color="red">*</font>：</td>
						<td>
							<input name="postcode" type="text" size="10" maxlength="6"  value="<%=userAddress.PostCode %>" />
						</td>
					</tr>
					<tr>
						<td style="text-align:right">联系电话：</td>
						<td>
							<input name="phone" type="text" size="20" maxlength="20" value="<%=userAddress.Phone %>" />   <font color="red">电话和手机请至少填写一个</font>
						</td>
					</tr>
					<tr>
						<td style="text-align:right">手机：</td>
						<td>
							<input name="mobile" type="text" size="20" maxlength="20"  value="<%=userAddress.Mobile %>" />   
						</td>
					</tr>
					
		            <tr>
			            <td style="height:20px"></td>
		            </tr>
					<tr>
		                <td style="text-align:right">
                            <asp:Button ID="btnSubmit" runat="server" Text=""  Width="64px"
                                onclick="btnSubmit_Click" />
		                </td>
		                <td><asp:Button ID="btnCancel" runat="server" Text="取消"  Width="64px" onclick="btnCancel_Click"
                                 /></td>
		            </tr>

				</table>						
	</div>

</asp:Content>
